package command 
{
	import cn.inswf.framework.mvcs.Command;
	import cn.inswf.injector.Instance;
	import event.ActionEvent;
	import event.AiccEvent;
	import event.PlayerEvent;
	import mediator.MediaPlayerMediator;
	import mediator.MenuMediator;
	import mediator.SkinMediator;
	import service.JsService;
	import util.ShareEvent;
	import view.MediaPlayerView;
	import view.MenuView;
	import view.SkinView;
	
	/**
	 * ...
	 * @author lee
	 */
	public class StartUpCommand extends Command 
	{
		public function StartUpCommand() 
		{
			
		}
		override public function execute():void 
		{
			getInstance(ShareEvent);
			getInstance(JsService);
			mapCommand(PlayerEvent.CHAPTER_LOADED, XmlDataLoadedCommand, PlayerEvent, true);
			mapCommand(PlayerEvent.MEDIAPLAYER_START,MediaPlayerStartCommand, PlayerEvent, true);
			mapCommand(AiccEvent.READ_COMPLETE,ReadDataCompleteCommand, AiccEvent);
			mapCommand(ActionEvent.ACTION, ActionCommand, ActionEvent);
			mapCommand(AiccEvent.SAVE, AiccSaveCommand, AiccEvent);
			var con:AppContext = getInstance(AppContext);
			con.linkActor(new Instance(MediaPlayerView), new Instance(MediaPlayerMediator));
			con.linkActor(new Instance(SkinView), new Instance(SkinMediator));
			con.linkActor(new Instance(MenuView), new Instance(MenuMediator));
		}
	}

}